package com.creditease.mobile.util;

import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.text.TextUtils;
import com.creditease.mobile.rss.RssConst;

public class PrefHelper {
    protected static final String sPrefName = RssConst.APP_NAME;

    public static boolean getBoolean(Context paramContext, String paramString, boolean paramBoolean) {
        return getSharedPreferences(paramContext).getBoolean(paramString, paramBoolean);
    }

    public static float getFloat(Context paramContext, String paramString, float paramFloat) {
        return getSharedPreferences(paramContext).getFloat(paramString, paramFloat);
    }

    public static int getInt(Context paramContext, String paramString, int paramInt) {
        return getSharedPreferences(paramContext).getInt(paramString, paramInt);
    }

    public static long getLong(Context paramContext, String paramString, long paramLong) {
        return getSharedPreferences(paramContext).getLong(paramString, paramLong);
    }

    public static SharedPreferences getSharedPreferences(Context paramContext) {
        if (TextUtils.isEmpty(sPrefName)) ;
        SharedPreferences localSharedPreferences = PreferenceManager.getDefaultSharedPreferences(paramContext);
        localSharedPreferences = paramContext.getSharedPreferences(sPrefName, Context.MODE_PRIVATE);
        return localSharedPreferences;
    }

    public static String getString(Context paramContext, String paramString1, String paramString2) {
        return getSharedPreferences(paramContext).getString(paramString1, paramString2);
    }

    public static void putBoolean(Context paramContext, String paramString, boolean paramBoolean) {
        getSharedPreferences(paramContext).edit().putBoolean(paramString, paramBoolean).commit();
    }

    public static void putFloat(Context paramContext, String paramString, float paramFloat) {
        getSharedPreferences(paramContext).edit().putFloat(paramString, paramFloat).commit();
    }

    public static void putInt(Context paramContext, String paramString, int paramInt) {
        getSharedPreferences(paramContext).edit().putInt(paramString, paramInt).commit();
    }

    public static void putLong(Context paramContext, String paramString, long paramLong) {
        getSharedPreferences(paramContext).edit().putLong(paramString, paramLong).commit();
    }

    public static void putString(Context paramContext, String paramString1, String paramString2) {
        getSharedPreferences(paramContext).edit().putString(paramString1, paramString2).commit();
    }

    public static void remove(Context paramContext, String paramString) {
        getSharedPreferences(paramContext).edit().remove(paramString).commit();
    }
}